package fun.yaozun.study.controller;

import fun.yaozun.study.common.MessageKeyEnum;
import fun.yaozun.study.controller.base.BaseController;
import fun.yaozun.study.model.RestModel;
import fun.yaozun.study.model.User;
import fun.yaozun.study.service.ITestService;
import fun.yaozun.study.service.impl.TestServiceImpl;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Auther: yaozun
 * @Date: 2018/5/9 0009 15:18
 * @Description:
 */
@RestController
public class StudyController extends BaseController {
    @Autowired
    private TestServiceImpl iTestService;

    @ApiOperation(value = "新增用户",notes = "新增用户")
    @RequestMapping(value = "/user/add",method = RequestMethod.POST)
    public RestModel addUser(User user){
        try{
            return iTestService.addUser(user);
        }catch (Exception e){
            return super.excpRestModel(MessageKeyEnum.ERROR);
        }
    }

}
